import {get} from '../../utils/request.js'
const state = {
orders:[],
total:0
}

const actions = {
// 查询所有订单
findAllOrder(context,list){
get('/order/pageQuery',list).then(res=>{
    console.log(res.data.list);
    let response = res.data.list
    let total = res.data.total
    context.commit('SET_ORDER',response)
    context.commit('SET_TOTAL',total)
})
}
}

const mutations = {
    SET_ORDER(state,response){
        state.orders = response
    },
    SET_TOTAL(state,total){
        state.total = total
    },
}

export default {
    namespaced:true,
    state,
    actions,
    mutations
}